//商品相关接口
import http from '@/utils/http'

// 商品列表
export const reqGoodsList = ({page,limit,category1Id,category2Id})=>{
  let url = ''
  if(category1Id && category2Id){
    url = `&category1Id=${category1Id}&category2Id=${category2Id}`
  }else if(category1Id){
    url = `&category1Id=${category1Id}`
  }else if(category2Id){
    url = `&category2Id=${category2Id}`
  }else{
    url = ''
  }
  return http.get(`/goodsList?_page=${page}&_limit=${limit}${url}`)
}

//商品详情接口
export const reqGoodsDetail = (id)=>{
  return http.get(`/goodsList/${id}`)
}